package com.shangqing.document_management.constant;
/**
 * 统一返回工具类
 */
public class ResultUtil {
    public static Result success(Object object,String state){
        Result result=new Result();
        result.setCode(400);
        result.setMessage("成功");
        result.setDate(object);
        result.setState(state);
        return result;
    }
    public static Result success(Object object){
        Result result=new Result();
        result.setCode(400);
        result.setMessage("成功");
        result.setDate(object);
        return result;
    }
    public static Result success(){
        return success(null);
    }
    public static Result error(Integer code,String msg,String state){
        Result result=new Result();
        result.setCode(code);
        result.setMessage(msg);
        result.setState(state);
        return result;
    }
    public static Result error(Integer code,String msg){
        Result result=new Result();
        result.setCode(code);
        result.setMessage(msg);
        return result;
    }
    public static Result error(){ return error();}
}
